<% breadcrumb :event_question, @event_question%>

<div class="row">
  <div class="col-lg-12">
    <div class="ibox float-e-margins">
      <div class="ibox-title">
        <h5>问题列表</h5>
      </div>
      <div class="ibox-content">
        <div class="row">
          <div class="col-md-12">
            <table class="table table-striped table-hover">
              <tr class="info">
                <td>#</td>
                <td>问题内容</td>
                <td>提问时间</td>
                <td>点赞数</td>
                <td>操作</td>
              </tr>
              <% @questions.each do |question|%>
                <tr>
                  <%= form_tag event_event_question_question_path(current_event, @event_question, question), method: 'PATCH' do %>
                    <td><%= question.id %></td>
                    <td><%= question.question_content %></td>
                    <td><%= question.created_at %></td>
                    <td>
                      <input type="text" name="praise_count" value="<%= question.praise_count %>" class="form-control">
                      <input type="hidden" name="question_id" value="<%= question.id %>">
                    </td>
                    <td>
                      <button type="submit" class="btn btn-sm btn-white">保存</button>
                      <%= link_to "删除", event_event_question_question_path(current_event, @event_question, question), method: :DELETE, data: {confirm: '是否确认删除？'}, class: 'btn btn-danger btn-sm' %>
                    </td>
                  <% end %>
                </tr>
              <% end %>
            </table>
          </div>
          <div class="col-md-12">
            <%= paginate @questions %>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
